//
//	CmComment.swift
//
//	Create by 松 松 on 3/6/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


open class CmComment : NSObject, NSCoding, SSMap{

	public var appCode : String?
	public var commentContent : String?
	public var commentDate : Int?
	public var commentId : String?
	public var commentReplyNum : Int?
	public var commentSate : Int?
	public var delFlag : Int?
	public var formUserId : String?
	public var fromUserHead : String?
	public var fromUserName : String?
	public var id : String?
	public var mainTypeCode : String?
	public var replyCommentId : String?
	public var toItemCode : String?


	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
    required public init(fromDictionary dictionary: [String:Any]){
		appCode = dictionary["appCode"] as? String
		commentContent = dictionary["commentContent"] as? String
		commentDate = dictionary["commentDate"] as? Int
		commentId = dictionary["commentId"] as? String
		commentReplyNum = dictionary["commentReplyNum"] as? Int
		commentSate = dictionary["commentSate"] as? Int
		delFlag = dictionary["delFlag"] as? Int
		formUserId = dictionary["formUserId"] as? String
		fromUserHead = dictionary["fromUserHead"] as? String
		fromUserName = dictionary["fromUserName"] as? String
		id = dictionary["id"] as? String
		mainTypeCode = dictionary["mainTypeCode"] as? String
		replyCommentId = dictionary["replyCommentId"] as? String
		toItemCode = dictionary["toItemCode"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
    public func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if appCode != nil{
			dictionary["appCode"] = appCode
		}
		if commentContent != nil{
			dictionary["commentContent"] = commentContent
		}
		if commentDate != nil{
			dictionary["commentDate"] = commentDate
		}
		if commentId != nil{
			dictionary["commentId"] = commentId
		}
		if commentReplyNum != nil{
			dictionary["commentReplyNum"] = commentReplyNum
		}
		if commentSate != nil{
			dictionary["commentSate"] = commentSate
		}
		if delFlag != nil{
			dictionary["delFlag"] = delFlag
		}
		if formUserId != nil{
			dictionary["formUserId"] = formUserId
		}
		if fromUserHead != nil{
			dictionary["fromUserHead"] = fromUserHead
		}
		if fromUserName != nil{
			dictionary["fromUserName"] = fromUserName
		}
		if id != nil{
			dictionary["id"] = id
		}
		if mainTypeCode != nil{
			dictionary["mainTypeCode"] = mainTypeCode
		}
		if replyCommentId != nil{
			dictionary["replyCommentId"] = replyCommentId
		}
		if toItemCode != nil{
			dictionary["toItemCode"] = toItemCode
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         appCode = aDecoder.decodeObject(forKey: "appCode") as? String
         commentContent = aDecoder.decodeObject(forKey: "commentContent") as? String
         commentDate = aDecoder.decodeObject(forKey: "commentDate") as? Int
         commentId = aDecoder.decodeObject(forKey: "commentId") as? String
         commentReplyNum = aDecoder.decodeObject(forKey: "commentReplyNum") as? Int
         commentSate = aDecoder.decodeObject(forKey: "commentSate") as? Int
         delFlag = aDecoder.decodeObject(forKey: "delFlag") as? Int
         formUserId = aDecoder.decodeObject(forKey: "formUserId") as? String
         fromUserHead = aDecoder.decodeObject(forKey: "fromUserHead") as? String
         fromUserName = aDecoder.decodeObject(forKey: "fromUserName") as? String
         id = aDecoder.decodeObject(forKey: "id") as? String
         mainTypeCode = aDecoder.decodeObject(forKey: "mainTypeCode") as? String
         replyCommentId = aDecoder.decodeObject(forKey: "replyCommentId") as? String
         toItemCode = aDecoder.decodeObject(forKey: "toItemCode") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if appCode != nil{
			aCoder.encode(appCode, forKey: "appCode")
		}
		if commentContent != nil{
			aCoder.encode(commentContent, forKey: "commentContent")
		}
		if commentDate != nil{
			aCoder.encode(commentDate, forKey: "commentDate")
		}
		if commentId != nil{
			aCoder.encode(commentId, forKey: "commentId")
		}
		if commentReplyNum != nil{
			aCoder.encode(commentReplyNum, forKey: "commentReplyNum")
		}
		if commentSate != nil{
			aCoder.encode(commentSate, forKey: "commentSate")
		}
		if delFlag != nil{
			aCoder.encode(delFlag, forKey: "delFlag")
		}
		if formUserId != nil{
			aCoder.encode(formUserId, forKey: "formUserId")
		}
		if fromUserHead != nil{
			aCoder.encode(fromUserHead, forKey: "fromUserHead")
		}
		if fromUserName != nil{
			aCoder.encode(fromUserName, forKey: "fromUserName")
		}
		if id != nil{
			aCoder.encode(id, forKey: "id")
		}
		if mainTypeCode != nil{
			aCoder.encode(mainTypeCode, forKey: "mainTypeCode")
		}
		if replyCommentId != nil{
			aCoder.encode(replyCommentId, forKey: "replyCommentId")
		}
		if toItemCode != nil{
			aCoder.encode(toItemCode, forKey: "toItemCode")
		}

	}

}
